//
//  ConfigDefineHeader.h
//  Btpin
//
//  Created by Vic on 2019/3/10.
//  Copyright © 2019 Vic. All rights reserved.
//

#ifndef ConfigDefineHeader_h
#define ConfigDefineHeader_h


//#ifdef DEBUG
//#define NSLog(...) NSLog(__VA_ARGS__)
//#define debugMethod() NSLog(@"%s", __func__)
//#else
//#define NSLog(...)
//#define debugMethod()
//#endif



#define iOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
#define iOS9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
#define iOS10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
#define iOS11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0)
#define iOS12 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 12.0)
#define iOS13 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 13.0)

static const CGFloat MJDuration = 0;

#define Scale (WIDTH/414.f)
#define ScalePS(m) (m*Scale)

#define HomeBannerHWScale (0.52)
#define HomeBannerHeight (IntCeil(WIDTH*HomeBannerHWScale))
#define KeyboardAnimationTime (0.2)
#define LimitText_Max_Number (200)
#define LimitTextViewText_Max_Number (100)
#define PageSize @"20"
#define QRCodeResolution (1000)
#define lineH (0.5)
#define LineSpacingHeight (5*Scale)
#define PSCellHeight (70*Scale)

#define LeftSpace (15*Scale)
#define JobCellHeight (140*Scale)
#define CompanyCellHeight (180*Scale)
#define MineCellHeight (50*Scale)
#define CompanyTagsHeight (26*Scale)
#define CompanyOfJobStatusCellHeight (110*Scale)

#define kKeyWindow [UIApplication sharedApplication].keyWindow
#define WIDTH ([UIScreen mainScreen].bounds.size.width)
#define HEIGHT ([UIScreen mainScreen].bounds.size.height)
//返回缩放后的尺寸
#define kAdaptScreen(size) size / 667 * HEIGHT
#define kAdaptWidth(size) ceilf(size / 375 * WIDTH)

#define PickerHeight (216.0*Scale)

#define isiPhone4 (HEIGHT == 480.f)
#define isiPhone5 (HEIGHT == 568.f)
#define isiPhone6 (HEIGHT == 667.f)
#define isiPhonePlus (HEIGHT == 736.f)
#define isiPhoneX (WIDTH == 375.f && HEIGHT == 812.f)
#define isiPhoneXr (WIDTH == 414.f && HEIGHT == 896.f)
#define isiPhoneXsMax (WIDTH == 414.f && HEIGHT == 896.f)

#define HeightOfTabBar ((isiPhoneX || isiPhoneXr || isiPhoneXsMax) ? (49.f+34.f) : 49.f)
#define HeightOfTabBarSafeMargin ((isiPhoneX || isiPhoneXr || isiPhoneXsMax) ? 34.f : 0.f)
#define HeightOfStatusBar ((isiPhoneX || isiPhoneXr || isiPhoneXsMax) ? 44.f : 20.f)
#define HeightOfStatusBarAndNavigationBar ((isiPhoneX || isiPhoneXr || isiPhoneXsMax) ? 88.f : 64.f)

#define StartX(view) CGRectGetMinX(view.frame)
#define StartY(view) CGRectGetMinY(view.frame)
#define EndX(view) CGRectGetMaxX(view.frame)
#define EndY(view) CGRectGetMaxY(view.frame)

#define ViewWidth(view) CGRectGetWidth(view.frame)
#define ViewHeight(view) CGRectGetHeight(view.frame)


#define RGB(r, g, b) ([UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0])
#define RGBA(r, g, b, a) ([UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a/1.0])

#define COLOR_OF_WHITE [UIColor whiteColor]
#define COLOR_OF_BLACK [UIColor blackColor]
#define COLOR_OF_CLEAR [UIColor clearColor]
#define THEMECOLOR_OF_WHITE RGB(250, 250, 250)
#define THEMECOLOR_OF_ORANGE RGB(255, 132, 0)
#define THEMECOLOR_OF_RED RGB(252, 26, 26)
#define THEMECOLOR_OF_BLUE RGB(0, 172, 243)
#define THEMECOLOR_OF_GREEN RGB(82, 219, 71)
#define THEMECOLOR_OF_GRAY RGB(245, 245, 245)
#define THEMECOLOR_OF_TEXT_333333 RGB(51, 51, 51)
#define THEMECOLOR_OF_TEXT_666666 RGB(102, 102, 102)
#define THEMECOLOR_OF_TEXT_9a9a9a RGB(154, 154, 154)
#define THEMECOLOR_OF_TEXT_cccccc RGB(204, 204, 204)
#define THEMECOLOR_OF_Line_Color RGB(230, 230, 230)



#define IntCeil(number) ceil(number)

#define Font_8 (8)
#define Font_9 (9)
#define Font_10 (10)
#define Font_11 (11)
#define Font_12 (12)
#define Font_13 (13)
#define Font_14 (14)
#define Font_15 (15)
#define Font_16 (16)
#define Font_17 (17)
#define Font_18 (18)
#define Font_19 (19)
#define Font_20 (20)
#define Font_21 (21)
#define Font_22 (22)
#define Font_23 (23)
#define Font_24 (24)
#define Font_25 (25)
#define Font_26 (26)
#define Font_27 (27)
#define Font_30 (30)
#define Font_35 (35)

#define Font(size) [UIFont systemFontOfSize:IntCeil(size*Scale)]
#define FontBold(size) [UIFont boldSystemFontOfSize:IntCeil(size*Scale)]

#define SVPHUDShow [SVProgressHUD show]
#define SVPHUDShowStatus(msg) [SVProgressHUD showWithStatus:msg]
#define SVPHUDDismiss [SVProgressHUD dismiss]
#define SVPHUDSuccess(msg) [SVProgressHUD showSuccessWithStatus:msg]
#define SVPHUDError(msg) [SVProgressHUD showErrorWithStatus:msg]


#define RequestTimeOutInterval (10.f)
#define SVPHUDDismissTime (2.0f)
#define RequestDataLimit (20)
#define CaptchaTime (60)


#define ToolBarViewHeight (49*Scale)

typedef NS_OPTIONS(NSUInteger, TabBarType) {
    TabBarTypeOfDefault                 =       0,
    TabBarTypeOfCompany                 =  1 << 1,  // 企业
    TabBarTypeOfPersonal                =  1 << 2,  // 个人
    TabBarTypeOfSignin                  =  1 << 3   // 登录
};

typedef NS_ENUM(NSUInteger, VCNilStatusType) {
    VCNilStatusTypeOfDefault                =   0,
    VCNilStatusTypeOfNoNet                  =   1,  // 没有网络
    VCNilStatusTypeOfWorkerList             =   2,  // 人才列表空
    VCNilStatusTypeOfWorkerCollect          =   3,  // 人才收藏空
    VCNilStatusTypeOfCompanyCollect         =   4,  // 公司收藏空
    VCNilStatusTypeOfJobCollect             =   5,  // 职位收藏空
    VCNilStatusTypeOfJobNoData              =   6,  // 职位列表空
    VCNilStatusTypeOfCommonNoData           =   8,  // 普通的没有数据
    VCNilStatusTypeOfCommonOperationError   =   9   // 操作出错（接口超时等）
};

typedef NS_OPTIONS(NSUInteger, PSCellType) {
    PSCellTypeOfDefault                =       0,
    PSCellTypeOfReadonly               =  1 << 1,  // 只展示
    PSCellTypeOfWriteonly              =  1 << 2,  // 只写（只是输入框）
    PSCellTypeOfReadwrite              =  1 << 3,  // 可编辑
    PSCellTypeOfIndicator              =  1 << 4   // 可编辑
};
typedef NS_OPTIONS(NSUInteger, PSShowTextCellType) {
    PSShowTextCellTypeOfDefault         =       0,
    PSShowTextCellTypeOfPrimaryTitle    =  1 << 1,  // 只展示主标题
    PSShowTextCellTypeOfSecondaryTitle  =  1 << 2,  // 只展示副标题
    PSShowTextCellTypeOfAll             =  1 << 3   // 全展示
};

typedef NS_OPTIONS(NSUInteger, AddOrEditType) {
    AddOrEditTypeOfDefault          =       0,
    AddOrEditTypeOfAdd              =  1 << 1,  // 添加
    AddOrEditTypeOfEdit             =  1 << 2   // 编辑
};

typedef NS_ENUM(NSUInteger, GeneralWebViewType) {
    GeneralWebViewTypeOfDefault                 =   0,
    GeneralWebViewTypeOfNews                    =   1,  // 新闻
    GeneralWebViewTypeOfGeneralize              =   2,  // 职位推广
    GeneralWebViewTypeOfIntegrityEmployer       =   3,  // 诚信雇主
    GeneralWebViewTypeOfInviteFriend            =   4,  // 邀请好友
    GeneralWebViewTypeOfCreditEvaluation        =   5,  // 职场信用评估
    GeneralWebViewTypeOfCoach                   =   6,  // 求职教练
    GeneralWebViewTypeOfHeadhunting             =   7,  // 猎头服务
    GeneralWebViewTypeOfPrivacyPolicy           =   8,  // 隐私政策
    GeneralWebViewTypeOfResignAgreement         =   9,  // 服务协议
    GeneralWebViewTypeOfNotice                  =   10, // 官方通知
    GeneralWebViewTypeOfWithdrawalInstructions  =   11, // 提现说明
    GeneralWebViewTypeOfMakeMoneyExplain        =   12, // 赚钱说明
    GeneralWebViewTypeOfNewsFlash               =   13  // 快讯
};

typedef NS_OPTIONS(NSUInteger, WorkerCellType) {
    WorkerCellTypeOfDefault         =       0,
    WorkerCellTypeOfNoTime          =  1 << 1,  // 不显示时间
    WorkerCellTypeOfOnlyTime        =  1 << 2,  // 只显示时间
    WorkerCellTypeOfCollect         =  1 << 3,  // 时间+收藏
    WorkerCellTypeOfLook            =  1 << 4   // 时间+查看
};
typedef NS_OPTIONS(NSUInteger, CollectType) {
    CollectTypeOfDefault            =       0,
    CollectTypeOfPersonal           =  1 << 1,  // 求职者的收藏
    CollectTypeOfCompany            =  1 << 2   // 招聘者的收藏
};
typedef NS_OPTIONS(NSUInteger, ResumeWorkCellType) {
    ResumeWorkCellTypeOfDefault             =       0,
    ResumeWorkCellTypeOfOneTextImg          =  1 << 1,  // 主标题和图
    ResumeWorkCellTypeOfTwoTextImg          =  1 << 2,  // 主、副标题和图
    ResumeWorkCellTypeOfOneTextDetail       =  1 << 3,  // 主标题和详情
    ResumeWorkCellTypeOfOneTextDetailImg    =  1 << 4,  // 主标题、详情和图
    ResumeWorkCellTypeOfTwoTextDetail       =  1 << 5,   // 主、副标题和详情
    ResumeWorkCellTypeOfTwoTextDetailImg    =  1 << 6   // 主、副标题、详情和图
};

typedef NS_OPTIONS(NSUInteger, TimeSelectPickerType) {
    TimeSelectPickerTypeOfDefault           =       0,  // 全部时间都可选择
    TimeSelectPickerTypeOfBirthday          =  1 << 1,  // 生日
    TimeSelectPickerTypeOfWorking           =  1 << 2   // 工作经历时间
};

typedef NS_OPTIONS(NSUInteger, MineHeaderViewTapType) {
    MineHeaderViewTapTypeOfDefault          =       0,  // 默认
    MineHeaderViewTapTypeOfRoleSwitch       =  1 << 1,  // 角色切换
    MineHeaderViewTapTypeOfEditInfo         =  1 << 2,   // 编辑基本资料
    MineHeaderViewTapTypeOfResume           =  1 << 3,   // 我的简历
    MineHeaderViewTapTypeOfDeliver          =  1 << 4,   // 我的投递
    MineHeaderViewTapTypeOfInvate           =  1 << 5,   // 复试邀请
    MineHeaderViewTapTypeOfAttention        =  1 << 6,   // 收藏关注
};

typedef NS_ENUM(NSUInteger, InfoEditType) {
    InfoEditTypeOfDefault               =   0,
    InfoEditTypeOfName                  =   1,  // 姓名
    InfoEditTypeOfNickName              =   2,  // 昵称
    InfoEditTypeOfPhoneNumber           =   3,  // 手机号
    InfoEditTypeOfEmail                 =   4,  // 邮箱
    InfoEditTypeOfDepartment            =   5,  // 部门
    InfoEditTypeOfPosition              =   6,  // 职位
    InfoEditTypeOfCompanyName           =   7,  // 公司名称
    InfoEditTypeOfCompanyNameForShort   =   8,  // 公司简称
    InfoEditTypeOfCompanyLandline       =   9,  // 公司座机
    InfoEditTypeOfCompanyAddress        =   10, // 公司地址
    InfoEditTypeOfCompanyWebURL         =   11, // 公司官网
    InfoEditTypeOfCompanyResponsibility =   12, // 岗位职责
    InfoEditTypeOfCompanyNotes          =   13  // 备注
};

typedef NS_OPTIONS(NSUInteger, HomeLinkType) {
    HomeLinkTypeOfDefault           =       0,
    HomeLinkTypeOfJobPromotion      =  1 << 1,  // 职位推广
    HomeLinkTypeOfBusinessCard      =  1 << 2,  // 职场名片
    HomeLinkTypeOfInvite            =  1 << 3,  // 邀请用户
    HomeLinkTypeOfCreditHashRate    =  1 << 4   // 信用算力
};


#endif /* ConfigDefineHeader_h */
